package com.robot.base.view.titlebar

import android.view.View
import android.widget.TextView
import androidx.appcompat.widget.AppCompatImageView
import androidx.appcompat.widget.AppCompatTextView
import com.robot.base.R

class ImageTextTitle(var title: String, var rightImgResId: Int, var rightTitle: String) : ITitleBar {


    override fun getViewResId(): Int {
        return R.layout.layout_img_text_title
    }

    override fun onBindTitleBar(titleView: View) {
        val tv = titleView.findViewById<TextView>(R.id.tv_title)
        tv.text = title

        val rightImageView = titleView.findViewById<AppCompatImageView>(R.id.iv_right)
        rightImageView.setImageResource(rightImgResId)

        val rightTextView = titleView.findViewById<AppCompatTextView>(R.id.tv_title_right)
        rightTextView.text = rightTitle
    }

}
